#ifndef ISCENEMANAGER_H
#define ISCENEMANAGER_H

#include "Vector2i.h"
#include <vector>
using namespace std;

class IShape;
class IShape;

//!Interface class for the scene manager. This class handle a quad tree used for collision detection.
class ISceneManager
{
public:
	//!Destructor
	virtual ~ISceneManager(){};

	//!Initialisation of the scene manager.
	/*!
	It creates an empty tree.
	\param depth Depth of the tree.
	*/
	virtual bool init(int depth)=0;

	//!Get a vector of entity. 
	/*!
	All the entities are in the same quad as entity. As an entity can be in several quad, indexLeaf says which quad we 
	want. If there is no vector of entity of the given index, it returns 0.
	\param entity A pointer to the entity that we want the quad from
	\param indexLeaf The index of the quad that we want.
	\return Return a pointer to a vector of entities. If indexLeaf doesn't exist, it returns 0.
	*/
	virtual vector<IShape*>* getVector(IShape* entity, int indexLeaf)=0;

	//!Update the position of an entity in the quad tree.
	/*!
	When an entity moves, it needs to be moved also in the quad tree.
	\param entity The entity to update.
	*/
	virtual void updateEntity(IShape* entity)=0;

	//!Scroll the boundaries of the quad tree.
	/*!
	When the world is scrolled, the boundaries of the quad tree become false. Scrolling them with the same vectors make
	them good again.
	\param v Vector representing the translation of the boundaries.
	*/
	virtual void scrollBoundaries(const CVector2i& v)=0;

	//!Add an entity in the quad tree.
	/*!
	\param entity A pointer to the entity to add in the quad tree.
	*/
	virtual void addEntity(IShape* entity)=0;

	//!Add an entity in the quad tree.
	/*!
	\param physicEntity A pointer to the entity to add in the quad tree.
	*/
};

#endif
